package cn.keduox.controller;

/**
 * 处理El表达式无法解析\r\n的类
 */
public class FormatJSEltarg {
    public static String format(String s) {
        if (s != null && s.length() > 0) {
            s = s.replaceAll("(\r|\n|\r\n|\n\r)", "<br>");
            s = s.replaceAll("\"", "\\\\" + "\"");
            s = s.replaceAll("\'", "\\\\" + "\'");
            return s;
        } else {
            return "";
        }
    }
}
